﻿

CREATE VIEW [dbo].[AmixViewIesite]
AS
SELECT     dbo.AmixRegistru.NrInventar, dbo.AmixRegistru.Denumire, dbo.AmixRegistru.ContAmortizare, dbo.AmixCatalog.Cod, dbo.AmixRegistru.DataIntrare, 
                      dbo.AmixRegistru.DataIesire, dbo.AmixRegistru.CodUnitate, dbo.Departamente.Nume, dbo.AmixRegistru.ContImobilizare, dbo.AmixRegistru.ContCheltuiala, 
                      dbo.AmixRegistru.DurataAmortizare, dbo.AmixRegistru.RegimAmortizare, dbo.AmixRegistru.ValoareInventar, dbo.AmixRegistru.ValoareAmortizata, 
                      0 AS ValoareRamasa, 0 AS AmortizareLuna, dbo.AmixRegistru.DurataAmortizare AS DurataNormata, dbo.AmixRegistru.LuniAmortizate, 
                      dbo.AmixTipStare.Denumire AS Stare, 0 AS Luna, 0 AS An, dbo.AmixRegistru.Blocat, dbo.AmixRegistru.Compus, 0 AS AmortizareBlocata, 
                      dbo.AmixRegistru.IDMijlocFix, dbo.AmixGestionari.Nume AS Gestionar, dbo.AmixRegistru.IDStare, dbo.AmixRegistru.StocFaptic, dbo.AmixRegistru.Categorie, 
                      dbo.AmixCatalog.Grupa, dbo.Departamente.IDDepartament, dbo.AmixRegistru.ContTransferForSuperior, dbo.AmixRegistru.ValoareIntrataTransfer, 
                      dbo.Jurnale.Codificare
FROM         dbo.AmixRegistru LEFT OUTER JOIN
                      dbo.Jurnale ON dbo.AmixRegistru.IDJurnal = dbo.Jurnale.IDJurnal LEFT OUTER JOIN
                      dbo.Departamente ON dbo.AmixRegistru.IDDepartament = dbo.Departamente.IDDepartament LEFT OUTER JOIN
                      dbo.AmixCatalog ON dbo.AmixRegistru.IDClasificare = dbo.AmixCatalog.IDClasificare LEFT OUTER JOIN
                      dbo.AmixTipStare ON dbo.AmixRegistru.IDStare = dbo.AmixTipStare.IDStare LEFT OUTER JOIN
                      dbo.AmixGestionari ON dbo.AmixRegistru.IDGestionar = dbo.AmixGestionari.IDGestionar
WHERE     (dbo.AmixRegistru.IDStare <> 5)